<%@ page import="projetstackoverflow.Question" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'question.label', default: 'Question')}" />
		<title><g:message code="default.create.label" args="[entityName]" /></title>
	</head>
	<body>
		<div id="create-question" class="content scaffold-create" role="main">
			<g:form action="save" >
				<div id="title-field">
					<div class="fieldcontain ${hasErrors(bean: questionInstance, field: 'title', 'error')} required">
						<div id="title-label"><h4>${message(code: 'default.title.label')}</h4></div>
						<g:textField required="" name="title" value="${questionInstance?.title}"/>
					</div>
				</div>
				
				<div id="content-field">
					<g:textArea required="" name="content" value="${questionInstance?.content}"/>
						
				</div>
				
				<div id="tags">
					<div id="tags-label"><h4>${message(code: 'default.tags.label')}</h4></div>
					<div id="tags-field">
						<div id="tags-list">
						</div>
						<g:textField name="question-tags"/></div>
				</div><br /><br />
				<g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" />
			</g:form><br /><br />
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${questionInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${questionInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			
		</div>
	</body>
</html>
